<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h = "http://java.sun.com/jsf/html"
      xmlns:f = "http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">
    <ui:fragment>
    <f:view>
    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>Our products</title>
    </h:head>
    <h:body>
        <h1>We can offer you:</h1>
        <hr/>

        <h:dataTable value="#{productController.productList}" var="pr">
            <h:column>
                <f:facet name="header">
                    <h:outputText value="Name" />
                </f:facet>
                <h:outputText value="#{pr.name}" />
            </h:column>

            <h:column>
                <f:facet name="header">
                    <h:outputText value="Category" />
                </f:facet>
                <h:outputText value="#{pr.cat}" />
            </h:column>

            <h:column>
                <f:facet name="header">
                    <h:outputText value="Description" />
                </f:facet>
                <h:outputText value="#{pr.desc}" />
            </h:column>

            <h:column>
                <f:facet name="header">
                    <h:outputText value="Price" />
                </f:facet>
                <h:outputText value="#{pr.price}" />
            </h:column>

            <h:column>
                <h:form>
                    <h:commandButton value="Buy!" action="#{shoppingCart.addProduct(pr)}" />
                </h:form>
            </h:column>

        </h:dataTable>


    </h:body>
    </f:view>
    </ui:fragment>
</html>
